import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTextArea;
import javax.swing.JRadioButton;
import javax.swing.JCheckBox;
import javax.swing.event.ChangeListener;
import javax.swing.event.ChangeEvent;
import javax.swing.JScrollPane;


public class Lizenz extends JDialog {

	public String Lizenz;
	public String Informations;
	public String Download;
	public String Version;
	private JCheckBox chkbox;
	private JButton okButton;
	
	private final JPanel contentPanel = new JPanel();
	private JScrollPane scrollPane;
	public JTextArea textArea;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		try {
			Lizenz dialog = new Lizenz();
			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			dialog.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Create the dialog.
	 */
	public Lizenz() {
		setTitle("Lizenz Bedingungen");
		setBounds(100, 100, 760, 501);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(new BorderLayout(0, 0));
		{
			scrollPane = new JScrollPane();
			contentPanel.add(scrollPane, BorderLayout.CENTER);
			{
				textArea = new JTextArea();
				scrollPane.setViewportView(textArea);
			}
		}
		{
			JPanel buttonPane = new JPanel();
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
			getContentPane().add(buttonPane, BorderLayout.SOUTH);
			{
				chkbox = new JCheckBox("Akzeptieren");
				chkbox.addChangeListener(new ChangeListener() {
					public void stateChanged(ChangeEvent e) {
						
						if(chkbox.isSelected()==true){
							okButton.setEnabled(true);
						}
						else if(chkbox.isSelected()==false){
							okButton.setEnabled(false);
						}
					
						
						
					}
				});
				buttonPane.add(chkbox);
			}
			{
				okButton = new JButton("Installieren");
				okButton.setEnabled(false);
				okButton.setActionCommand("OK");
				buttonPane.add(okButton);
				getRootPane().setDefaultButton(okButton);
			}
			{
				JButton cancelButton = new JButton("Abrechen");
				cancelButton.setActionCommand("Cancel");
				buttonPane.add(cancelButton);
			}
		}
	}

}
